package cn.xspace.module.other.http.req;

import com.xspace.android.xafcommon.network.message.ARequestMsg;
import com.xspace.android.xafcommon.util.Constants;
import com.xspace.android.xafcommon.util.LogUtils;


public class FetchVertifyCodeReq extends ARequestMsg {
	public String mobile;
	private boolean isRegister;
	public String flag = "0";
	/**
	 * @Description: TODO
	 * @param
	 * @return
	 * @throws
	 */
	public FetchVertifyCodeReq(boolean isRegister) {
		this.isRegister = isRegister;
	}

	@Override
	public String getURL() {
		if (isRegister) {
			return Constants.URL_FETCH_VERTIFYCODE_FOR_REGISTER;
		} else {
			return Constants.URL_FETCH_VERTIFYCODE_FOR_PASSWORD;
		}
	}

	@Override
	protected byte[] toBytes() {
		String value = "{mobile:\"" + mobile + "\",\"flag\":\""+flag+"\"}";
		if (!isRegister) {
			 value = "{mobile:\"" + mobile + "\"}";
		} 
		LogUtils.d("FetchVertifyCodeReq==>" + value);
		return value.getBytes();
	}

	/*
	 * <p>Title: toJson</p> <p>Description: </p>
	 * 
	 * @return
	 * 
	 * @see com.xspace.android.xafcommon.network.message.ARequestMsg#toJson()
	 */
	@Override
	protected String toJson() {
		return null;
	}

}
